<!-- 设置 -->
import func from './vue-temp/vue-editor-bridge';
<template>
    <div style="background:#f8f8f9">
        <Tabs :value=name style="background:#f8f8f9">
            <TabPane v-if='quanxian==12||quanxian=="Ent"' label="系统设置" name="name1">
                <Row :gutter="16" style="margin-bottom:20px;display: flex;justify-content: space-between;" >
                    <Col span="11">
                    <Card style="height:360px">
                        <p slot="title">编号方式</p>
                        <!-- <br> -->
                        <br>
                        <RadioGroup v-model="radioGroupIsTrue" @on-change="changebianhao" >
                            <Radio v-for="item in bianhao"  :key="item.ID" :label="item.ID" >
                                <span>{{item.Name}}</span>
                                <p>{{item.Explain}}</p>
                                <br/>
                            </Radio>
                        </RadioGroup>
                    </Card>
                    </Col>
                    <Col span="13" style="height: 357px;">
                    <Card style="height:360px;overflow-y: scroll;">
                      <div style="height:10%;">
                          <p slot="title">
                            <Row>
                                <Col span="12">
                                项目审核级数
                                </Col>
                                <Col span="12" style="text-align:right;">
                                <!--<Button type="primary" @click="pushData">-->
                                    <!--添加-->
                                <!--</Button>-->
                                </Col>
                            </Row>
                        </p>
                      </div>
                        <Table border :columns="columns7" :data="branchNotTrue"></Table>
                        <!--<Table border :columns="columns8" :show-header="false" :data="companyListTemp" no-data-text="点击按钮添加数据"></Table>-->
                       <!-- <div style="width=100%;display:table;margin:0 auto;">
                          <Select v-model="company" style="width:148px">
                          <Option v-for="item in companyList" :value="item.ID" :key="item.ID">{{ item.Name }}</Option>
                          </Select>
                          <Select v-model="company1" style="width:148px">
                              <Option v-for="item in data2" :value="item.value" :key="item.value">{{ item.label }}</Option>
                          </Select>
                        </div>-->
                    </Card>
                    </Col>
                </Row>
                <Row>
                    <Col span="24" style="overflow-y: scroll;">
                    <Card>
                        <p slot="title">
                            <Row>
                                <Col span="12">
                                工程师库
                                </Col>
                                <Col span="12" style="text-align:right">
                                <Button type="primary" @click="addGcs">
                                    添加
                                </Button>
                                <Button type="error" @click="delBtn">
                                    删除
                                </Button>
                                <Modal v-model="delModalConfirm" width="360" :mask-closable='false'>
                                    <p slot="header" style="color:#f60;text-align:center">
                                        <Icon type="ios-information-circle"></Icon>
                                        <span>删除确认</span>
                                    </p>
                                    <div style="text-align:center">
                                        <p>确认要删除选中的人员，删除后将不在工程师库显示。</p>
                                        <p>是否要继续删除?</p>
                                    </div>
                                    <div slot="footer">
                                        <Button type="error" size="large" long :loading="delLoading" @click="delengineerSelect">删除</Button>
                                    </div>
                                </Modal>
                                </Col>
                            </Row>
                        </p>
                        <Table border :columns="columns1" :data="data1" :loading='sqeLoading' @on-selection-change='engineerSelect'></Table>
                        <div style="margin: 10px;overflow: hidden">
                            <div style="float: right;">
                                <Page :total="this.total" :current="1" show-total @on-change='pageTabs'></Page>
                            </div>
                        </div>
                    </Card>
                    </Col>
                </Row>
                <!-- <div style="margin: 10px;overflow: hidden">
                    <div style="float: right;">
                        <Page :total="this.total" :current="1"></Page>
                    </div>
                </div> -->
            </TabPane>
            <TabPane label="安全设置" name="name2">
                <Card :bordered="false">
                    <p slot="title">密码修改</p>
                    <Row>
                        <Col span="12" offset="1">
                        <Form ref="changepassword" :model="changepassword" :rules="ruleInline"   :label-width="100">
                            <FormItem label="登录账户" style="font-size:15px;">
                                {{mobile}}
                            </FormItem>
                            <!-- <br> -->
                            <FormItem label="输入原密码" prop="name">
                                <Input type="password" v-model="changepassword.OldPassword" placeholder=""></Input>
                            </FormItem>
                            <FormItem label="输入新密码" prop="mail">
                                <Input type="password" v-model="changepassword.NewPassword" placeholder=""></Input>
                            </FormItem>
                            <FormItem label="确认新密码" prop="newPassword">
                                <Input type="password" v-model="changepassword.ConfirmNewPassword" placeholder=""></Input>
                            </FormItem>
                            <FormItem>
                                <Button type="primary" @click="changeword">确认</Button>
                            </FormItem>
                        </Form>

                        </Col>
                    </Row>
                </Card>
            </TabPane>
            <TabPane v-if='quanxian==12||quanxian=="Ent"' label="绩效规则" name="name3">
                <Card>
                    <p slot="title">绩效规则</p>
                    <Row>
                        <Col span="16">
                            <table width="100%" cellspacing="0" cellpadding="0" border="1">
                                <tr>
                                    <th colspan="2" width="33.3%">
                                        报告类型
                                    </th>
                                    <th width="33.3%">
                                        审批部门
                                    </th>
                                    <!-- <th width="33.3%">
                                        绩效
                                    </th> -->
                                </tr>
                                <tr>
                                    <td rowspan="12">
                                        一般报告表
                                    </td>
                                    <td>
                                        无专项
                                    </td>
                                    <td rowspan="4">
                                        县批
                                    </td>
                                    <!-- <td style="">
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;" @on-change='input' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        1个专项
                                    </td>
                                    <!-- <td style="">
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;" @on-change='input' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        2个专项
                                    </td>
                                    <!-- <td style="">
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        3个专项
                                    </td>
                                    <!-- <td style="">
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        无专项
                                    </td>
                                    <td rowspan="4">
                                        市批
                                    </td>
                                    <!-- <td style="">
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>

                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        1个专项
                                    </td>
                                    <!-- <td style="">
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        2个专项
                                    </td>
                                    <!-- <td style="">
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        3个专项
                                    </td>
                                    <!-- <td style="">
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        无专项
                                    </td>
                                    <td rowspan="4">
                                        省批/部批
                                    </td>
                                    <!-- <td style="">
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>

                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        1个专项
                                    </td>
                                    <!-- <td style="">
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        2个专项
                                    </td>
                                    <!-- <td style="">
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        3个专项
                                    </td>
                                    <!-- <td style="">
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td rowspan="4">
                                        核与辐射报告表
                                    </td>
                                    <td>
                                        无专项
                                    </td>
                                    <td rowspan="2">
                                        市批
                                    </td>
                                    <!-- <td>
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        1个专项
                                    </td>
                                    <!-- <td>
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        无专项
                                    </td>
                                    <td rowspan="2">
                                        省批/部批
                                    </td>
                                    <!-- <td>
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        1个专项
                                    </td>
                                    <!-- <td>
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td rowspan="3" colspan="2">
                                        报告书
                                    </td>
                                    <td>
                                        县批
                                    </td>
                                    <!-- <td>
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        市批
                                    </td>
                                    <!-- <td>
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <tr>
                                    <td>
                                        省批/部批
                                    </td>
                                    <!-- <td>
                                        <p v-if="flag" style="">{{num}}
                                            <Icon style="" type="md-create" @click='edit()' />
                                        </p>
                                        <div v-else>
                                            <Input type="text" style="width: 60%;"  @change='input()' />
                                            <Icon type="md-checkmark" @click='save()' />
                                        </div>
                                    </td> -->
                                </tr>
                                <!-- <tr>
                                    <td>
                                        部批
                                    </td>
                                </tr> -->
                                <tr>
                                    <td colspan="2">
                                        规划
                                    </td>
                                    <td>
                                        /
                                    </td>
                                    <!-- <td>
                                        2000
                                    </td> -->
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        验收报告
                                    </td>
                                    <td>
                                        /
                                    </td>
                                    <!-- <td>
                                        2000
                                    </td> -->
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        后评价
                                    </td>
                                    <td>
                                        /
                                    </td>
                                    <!-- <td>
                                        2000
                                    </td> -->
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        跟踪评价
                                    </td>
                                    <td>
                                        /
                                    </td>
                                    <!-- <td>
                                        2000
                                    </td> -->
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        现状评估报告
                                    </td>
                                    <td>
                                        /
                                    </td>
                                    <!-- <td>

                                    </td> -->
                                </tr>
                            </table>
                        </Col>
                        <Col span="8">
                            <Table border :columns="columnsAci" :data="dataAci"></Table>
                        </Col>
                    </Row>
                </Card>
            </TabPane>
        </Tabs>
        <!-- 添加工程师 -->
        <Modal 
        v-model="modalAddEngineer"
        @on-ok="gcsAdd"
        width="700px"
        title="添加工程师">
            <div style="overflow:auto;height:500px;">
                <Table border highlight-row :columns="columnsEngineer" @on-selection-change="addSele" @on-select-all="allAdd" :data="dataEngineer"></Table>
            </div>
        </Modal>
    </div>
</template>

<script type="text/javascript">
    export default {
        data() {
            return {
                name: 'name1',
                delModalConfirm: false, //删除Modal
                delLoading: false,     //删除中...
                delMember: '',         //删除工程师member
                sqeLoading: true,
                pageNum: 1,
                quanxian:'',//判断权限
                company: '',
                company1: '',
                total: 0,
                radioGroupIsTrue:'',
                bianhao:[],
                data2: [
                    {
                        value: '0',
                        label: '三级'
                    },{
                        value: '1',
                        label: '五级'
                    }
                ],
                modalAddEngineer: false,
                columnsEngineer: [
                    {
                        type: 'index',
                        title: "序号",
                        width: 60,
                        align: 'center',
                        render: (h,params)=>{
                          return h('span',(params.index +1)+(this.pageNum-1)*10)
                        }
                    },
                    {
                        title: '姓名',
                        align: 'center',
                        key: 'realName'
                    },
                    {
                        title: '性别',
                        key: 'sex',
                        align: 'center',
                        render: (h, params) => {
                            return h("div", [h("p",params.row.sex == 'M'? '男':'女')
                            ]);
                        }
                    },
                    {
                        title: '职位',
                        align: 'center',
                        key: 'position'
                    },
                    {
                        title: '公司级别',
                        align: 'center',
                        key: 'gs'
                    },
                    {
                        title: '所属部门',
                        align: 'center',
                        key: 'branch'
                    },
                    {
                        type: 'selection',
                        width: 60,
                        align: 'center'
                    }
                ],
                dataEngineer:[
                ],
                columns1: [
                    {
                        type: 'index2',
                        title: "序号",
                        width: 60,
                        align: 'center',
                        render: (h,params)=>{
                          return h('span',(params.index +1)+(this.pageNum-1)*10)
                        }
                    },
                    {
                        align: "center",
                        title: "姓名",
                        key: "userName",
                    },
                    {
                        align: "center",
                        title: "登记证号",
                        key: "regNumber",
                    },
                    {
                        align: "center",
                        title: "登记类别",
                        key: "registerClass",
                    },
                    {
                        align: "center",
                        title: "现有项目数量",
                        // key: "xysl",
                        key: "projectNumber",
                        
                    },
                    {
                        align: "center",
                        title: "登记有效期",
                        key: "",
                        render: (h,params)=>{
                            return h('span',(params.row.startTime == null ?'':params.row.startTime) + '--' +(params.row.endTime == null ? '':params.row.endTime))
                        }
                    },
                    {
                        align: "center",
                        title: "审核项目数",
                        key: "projectNumbers"
                    },
                    {
                        align: "center",
                        title: "审核权限",
                        key: "permissions",
                        render: (h, params) => {  
                            return h("div", [h("Select",{
                                props:{
                                   value: params.row.permissions
                                },
                                on: {
                                    'on-change': (val) => {
                                    params.row.permissions = val
                                    this.jurisdiction(val,params.row.member)
                                    }
                                }
                            },
                            this.toExamine.map((i)=>{
                                return h("Option",{
                                    props:{
                                        value: i.value,
                                        label: i.label
                                    }
                                },i.label)
                            })
                            )]);
                        }
                    },
                    {
                      type: 'selection',
                      width: 60,
                      align: 'center'
                    }
                ],
                data1: [
                ],
                columns7: [
                    {
                        align: "center",
                        title: '公司级别',
                        key: 'Name',
                        render: (h, params) => {
                            console.log()
                            return h('p',params.row.Name)
                            // return h('Select', {
                            //     props:{
                            //         value: this.branchNotTrue[params.index].ID
                            //     },
                            //     on: {
                            //         'on-change': (event) => {
                            //             value: this.branchNotTrue[params.index].ID = event;
                            //         }
                            //     },
                            // },
                            // this.branchNotTrue.map(function(e){
                            //     return h(
                            //         "Option",
                            //         {
                            //             props:{
                            //                 value: e.ID,
                            //                 // disabled: e.ID
                            //             }
                            //         },
                            //         e.Name
                            //     );
                            // })
                            // );
                        },
                    },
                    {
                        align: "center",
                        title: '环评项目审核级数',
                        key: 'Tof',
                        render: (h, params) => {
                            return h('div', [
                                h('Select', {
                                    props: {
                                        value: this.branchNotTrue[params.index].Tof == '' || this.branchNotTrue[params.index].Tof == null ? '1' : this.branchNotTrue[params.index].Tof 
                                    },
                                    on: {
                                        'on-change': (event) => {
                                            value: this.branchNotTrue[params.index].Tof = event;
                                        }
                                    },
                                },
                                this.data2.map((e)=>{
                                    return h(
                                        "Option",
                                        {
                                            props:{
                                                value: e.value,
                                                // label: e.label
                                            }
                                        },e.label
                                    );
                                })
                                )
                            ]);
                        }
                    },
                    {
                        align: "center",
                        title: '操作',
                        key: 'action',
                        width: 150,
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('Button', {
                                    props: {
                                        type: 'primary',
                                    },
                                    on: {
                                        click: () => {
                                            this.updateLevel(this.branchNotTrue[params.index].ID,this.branchNotTrue[params.index].Tof)
                                        }
                                    }
                                }, '保存'),
                                h('Button', {
                                    props: {
                                        type: 'error',
                                        // size: 'small'
                                    },
                                    on: {
                                        click: () => {
                                            this.remove(this.branchNotTrue[params.index].ID)
                                        }
                                    }
                                }, '删除')
                            ]);
                        }
                    }
                ],
                columns8:[
                    {
                        align: "center",
                        title: '公司级别',
                        key: 'Name',
                        render: (h, params) => {
                            return h('Select', {
                                    props:{
                                        value: this.companyListTemp[params.index].ID
                                    },
                                    on: {
                                        'on-change': (event) => {
                                            this.companyListTemp[params.index].ID = event
                                        }
                                    },
                                },
                                this.companyList.map(function(e){
                                    return h(
                                        "Option",
                                        {
                                            props:{
                                                value: e.ID,
                                            }
                                        },
                                        e.Name
                                    );
                                })
                            );
                        },
                    },
                    {
                        align: "center",
                        title: '环评项目审核级数',
                        key: 'Tof',
                        render: (h, params) => {
                            return h('div', [
                                h('Select', {
                                        props: {
                                            value: this.companyListTemp[params.index].Tof
                                        },
                                        on: {
                                            'on-change': (event) => {
                                                value: this.companyListTemp[params.index].Tof = event;

                                            }
                                        },
                                    },
                                    this.data2.map((e)=>{
                                        return h(
                                            "Option",
                                            {
                                                props:{
                                                    value: e.value,
                                                    // label: e.label
                                                }
                                            },e.label
                                        );
                                    })
                                )
                            ]);
                        }
                    },

                    {
                        align: "center",
                        title: '操作',
                        key: 'action',
                        width: 150,
                        align: 'center',
                        render: (h, params) => {
                            return h('div', [
                                h('Button', {
                                    props: {
                                        type: 'primary',
                                    },
                                    on: {
                                        click: () => {
                                            // this.remove(params.index)
                                             this.updateLevel2(this.companyListTemp[params.index].ID,this.companyListTemp[params.index].Tof,params.index)
                                        }
                                    }
                                }, '保存'),
                                h('Button', {
                                    props: {
                                        type: 'error',
                                        // size: 'small'
                                    },
                                    on: {
                                        click: () => {
                                            this.companyListTemp.splice(params.index, 1);
                                        }
                                    }
                                }, '删除')
                            ]);
                        }
                    }
                ],
                
                branchNotTrue: [],              //表格需要遍历的数据
                companyList: [],                //select需要的数据
                companyListTemp:[],
                phone: 'apple',
                flag: true,
                num: "",
                formValidate: {
                    name: "",
                    mail: "",
                    newPassword: ""
                },
                
                // 修改密码的参数
                changepassword:{
                    OldPassword:'',
                    NewPassword:'',
                    ConfirmNewPassword:''
                },
                mobile: '',
                // 表单验证
                ruleInline: {
                    OldPassword: [{
                        required: true,
                        message: "原密码不能为空",
                        trigger: "blur"
                    }],
                    NewPassword: [{
                        required: true,
                        message: "新密码不能为空",
                        trigger: "blur"
                    }],
                    ConfirmNewPassword: [{
                        required: true,
                        message: "新密码不能为空",
                        trigger: "blur"
                    }]
                },
                aciInfo: {},
                columnsAci: [
                    // {
                    //     title: '报告类型',
                    //     key: 'Report_type',
                    //     align: 'center'
                    // },
                    // {
                    //     title: '专项',
                    //     key: 'Special',
                    //     align: 'center'
                    // },
                    // {
                    //     title: '审批部门',
                    //     key: 'Department',
                    //     align: 'center'
                    // },
                    {
                        title: '绩效',
                        key: 'Achievements',
                        align: 'center',
                        render: (h,params)=>{
                            return h("div",[
                                h("Input",{
                                    props: {
                                        value: params.row.Achievements,

                                    },
                                    style: {
                                        width: '120px',
                                        size: 'small'
                                    },
                                    on: {
                                        'input': (val)=>{
                                            params.row.Achievements = val
                                        }
                                    }
                                },params.row.Achievements),
                                h("Icon",{
                                    props: {
                                        type:"md-checkmark"
                                    },
                                    on: {
                                        click: ()=>{
                                            this.setAci(params.row)
                                        }
                                    },
                                    style: {
                                        'margin-left': '10px',
                                        size: '26px',
                                        cursor: 'pointer',
                                        
                                    }
                                })
                            ])
                        }
                    },
                ],
               
                dataAci: [
                ],
                selectionData: [],
                toExamine: [
                    {value: 0,label: "审核"},
                    {value: 1,label: "无"}
                ],
                addMember: [],
            };
            
        },
        methods: {
          // 工程师库多选
          engineerSelect(selection) {
            var delMember =[];
            selection.forEach(e => {
              delMember.push(e.member)
            });
            this.delMember = delMember.join(',')
          },
          delBtn() {
            if(!this.delMember) {
              this.$Message.warning('请选择要删除的人员！');
            }else {
              this.delModalConfirm = true
            } 
          },
          delengineerSelect() {
            this.delLoading = true
            axios.post('/engineer/deleteMember',{Member:this.delMember}).then(res=>{
              if(res._STATUS==1) {
                this.delLoading = false
                this.delModalConfirm = false
                this.$Message.success(res._MESSAGE)
                this.delMember = ''
                this.getLibrary() // 刷新工程师库
              }else {
                this.delLoading = false
                this.delModalConfirm = false
                this.$Message.error(res._MESSAGE)
              }
            }).catch(err=>{
              console.log(err)
            })
          },
          pageTabs(val) {
            this.sqeLoading = true
            this.pageNum = val
            this.getLibrary()
          },
            addSele(selection){
                var member = []
                selection.forEach((i)=>{
                    member.push(i.memberId)
                })
                this.selectionData = member.join(',')
                console.log(this.selectionData)
            },
            allAdd(selection){
                var member = []
                selection.forEach((i)=>{
                    member.push(i.memberId)
                })
                this.selectionData = member.join(',')
                console.log(this.selectionData)
            },
            gcsAdd(){           //添加工程师
                // console.log(this.selectionData.memberId)
                this.$Message.info('正在添加')
                axios.post('engineer/addMember',{
                    ids: this.selectionData
                }).then((res)=>{    
                    if(res._STATUS == 1){
                        this.$Message.success(res._MESSAGE)
                        this.getLibrary()
                    }
                }).catch((err)=>{
                    console.log(err)
                })
            },
            addGcs(){               //获取工程师库
                this.modalAddEngineer = true;
                this.$post('engineer.findMember',{}).then((res)=>{
                    this.dataEngineer = res.list
                    // console.log(res)
                }).catch((err)=>{
                    console.log(err)
                })
            },
            // 修改密码
            changeword(){
                axios.post('/member/resetpwd',this.changepassword)
                .then((res)=>{
                    console.log(res);
                    if(res._STATUS == 0){
                        this.$Message.error(res._MESSAGE)
                    }else if(res._STATUS == 1){
                        this.$Message.success(res._MESSAGE)
                        this.changepassword.OldPassword = ''
                        this.changepassword.NewPassword = ''
                        this.changepassword.ConfirmNewPassword = ''
                    }
                })
            },
           contains(arr, obj) {
                var i = arr.length;
                while (i--) {
                    if (arr[i].ID === obj) {
                        return true;
                    }
                }
                return false;
            },
            pushData(){
                axios.post('/branch/findLevel').then((res)=>{
                    this.branchNotTrue = res.branchNotTrue;
                    for(let i =0;i<res.branchIsTrue.length;i++){
                        if(this.companyListTemp.length==0){
                            this.companyListTemp.push(res.branchIsTrue[i])
                            return;
                        }
                        if(!this.contains(this.companyListTemp,res.branchIsTrue[i].ID)){
                            this.companyListTemp.push(res.branchIsTrue[i])
                            return;
                        }
                        if(res.branchIsTrue.length==this.companyListTemp.length){
                            this.$Message.error("没有需要修改的数据了")
                            return;
                        }
                    }
                    this.companyList = res.branchIsTrue;
                }).catch((err)=>{
                    console.log(err)
                })
            },
            changebianhao(value){
                axios.post('branch/updateNumberType',{
                    Id:value
                }).then((res)=>{
                    if(res._STATUS==1){
                        this.$Message.success(res._MESSAGE)
                    }else{
                        this.$Message.error(res._MESSAGE)
                    }
                axios.post('branch/findNumberType').then((res)=>{    
                    if(res._STATUS==1){
                        this.bianhao=res.numberTypeList;
                        this.radioGroupIsTrue =''+res.isTrue;
                    }
                    }).catch((err)=>{
                    console.log(err)
                })
                    console.log(res)
                    }).catch((err)=>{
                    console.log(err)
            })
            },
           
            edit() {
                this.flag = false;
            },
            input(data) {
                console.log(data)
            },
            save() {
                this.flag = true;
            },
            remove(ID){
                axios.post('/branch/deleteLevel',{
                    ID:ID,
                }).then((res)=>{
                    this.findLevel();
                }).catch((err)=>{
                    console.log(err)
                })
            },
            findLevel(){
                //项目审核级数
                axios.post('/branch/findLevel').then((res)=>{
                    this.branchNotTrue = res.branchNotTrue;
                    this.companyList = res.branchIsTrue;
                }).catch((err)=>{
                    console.log(err)
                })
            },
            updateLevel(ID,Tof){
                axios.post('/branch/updateLevel',{
                    Id:ID,
                    Tof:Tof
                }).then((res)=>{
                    this.findLevel();
                    this.$Message.success("保存成功")
                }).catch((err)=>{
                    console.log(err)
                })
            },
            updateLevel2(ID,Tof,Index){
                axios.post('/branch/updateLevel',{
                    Id:ID,
                    Tof:Tof
                }).then((res)=>{
                    this.companyListTemp.splice(Index, 1);
                    this.findLevel();
                    this.$Message.success("保存成功")
                }).catch((err)=>{
                    console.log(err)
                })
            },
            getAci(){                       //绩效规则
                axios.get('achievements/findAchievements').then((res)=>{
                    console.log(res)
                    this.dataAci = res.achievements
                }).catch((err)=>{
                    console.log(err)
                })
            },
            setAci(data){
                axios.post('achievements/updateAchievements',{
                    achievements: data.Achievements,
                    achievementsId: data.AchievementsId
                }).then((res)=>{
                    if(res._STATUS == 1){
                        this.$Message.success('操作成功')
                    }else{
                        this.$Message.error('操作失败')
                    }
                }).catch((err)=>{
                    console.log(err)
                })
            },
            getLibrary(){
                axios.post('engineer/engineerList',{
                  PageIndex: this.pageNum-1
                }).then((res)=>{
                    console.log(res)
                  if(res._STATUS==1) {
                    this.sqeLoading = false
                    this.data1 = res.emList
                    this.total = res.total
                    console.log(this.data1)
                  } 
                }).catch((err)=>{
                    console.log(err)
                })
            },
            jurisdiction(val,member){
                axios.post("engineer/update",{
                    Member: member,
                    permissions: val
                }).then((res)=>{
                    if(res._MESSAGE == "操作成功"){
                        this.$Message.success(res._MESSAGE)
                    }
                })
            }
        },
        mounted(){
            //请求编号数据
            axios.post('branch/findNumberType').then((res)=>{
                this.bianhao=res.numberTypeList;
                this.radioGroupIsTrue =''+res.isTrue;
                }).catch((err)=>{
                console.log(err)
            })
            this.findLevel();
            this.getAci();
            this.mobile = localStorage.getItem('mobile')
            this.getLibrary()
            this.quanxian=localStorage.getItem('userOrg')
            this.name = this.quanxian == 12 || this.quanxian == 'Ent' ? 'name1':'name2'
        }
    };
</script>

<style scoped>
.ivu-form-item{
    margin-top: 10px;
}
.ivu-radio-wrapper{
    display: block !important;
}
.ivu-table-overflowX{ overflow-x: hidden;}
table tr td{
    height: 48px;
}
</style>